I'd phrase my question in the plural:
I'm looking for AA batteries. Do you have any?
In practice, it isn't usually necessary to pronounce the second sentence. Unless you speak quickly, the shop assistant will probably cut you off and tell you where to find them.
As you say, they are rarely sold in the singular. However, there is nothing wrong with saying:
I'm looking for an AA battery. Do you have any?
The shop assistant will either show you where to find the packs of batteries (as before) or fetch them for you if they're behind the counter (as before), or they might say "We only sell them in packs of four or eight - is that OK?".
Don't say "I'm looking for an AA battery. Do you have it?", because the "it" makes it sound as though you're looking for a specific battery, perhaps one that you accidentally dropped while walking around.
Note: When using the indefinite article before "AA" or "AAA", we say "an" if we are pronouncing "AA" or "AAA" as individual letters. If we are pronouncing "AA" as "double-A" and "AAA" as "triple-A" or "treble-A", we say "a".