Yes! I get that same feeling! I don't know if it's social anxiety or what, but it happens especially while waiting in line. I imagine myself just dropping everything I am holding and running out of the store to my car! Then that makes me tense up even more! I get the same way in very crowded places.
I just try to immediately take a slow deep breath, and remember everything is OK. There is nothing dangerous or "bad" happening around me, I would just rather be at home. Which is a normal feeling, I don't think many people really enjoy going to a store and waiting in line! So, I just continue to take deep breaths reminding myself, everything's OK, you're not going to be trapped here forever.
So, I guess I don't really know how to prevent it, I just kind of have a way of dealing with it. Hope it helps some!
Concentrate on breathing normally: regularly and slowly. It works for me every time. Don't worry about what other people think of you, hun. If you must, just step out of line (or out of whatever situation is bothering you), walk a bit away for a few moments to calm down, then go back. Hope this helps. Blessings - Blu