Sounds like a panic attack to me, but you still might want to talk to a doctor about it. I didn't see any other symptoms listed, but panic attacks come out of the blue and can leave you foggy headed, out of breath, shaky and tingling extremeties... and coffee can trigger them. Panic attacks can last anywhere from a few seconds to an hour. Also, what RNRita says is common too, if you are sitting in one position too long it can cause in some people blood pressure changes that can cause a lot of the same symptoms. I agree talk to your doctor. Hope all goes well.
Happens to me here and there. Sometimes it is caused, for me at least, by scrunching too much. If I arch my back for a bit and take the pressure off that side, it eases up. Whatever you do, don't let it scare you. If it happens again, you should still go to the doc, get checked and, once you see you are normal, you'll be much better.