It's sleep paralysis. I've had some mild cases of it upon waking. My 'tricks' to getting out of it are:
1) Breath nice and steady, deep breaths. You *can* physically still breathe even if it doesn't feel like it, so forcing yourself to remember that and to slow your heartbeat can help.
2) I know you can't move, but focusing really hard on trying to jerk my body will help. You don't actually have to move anything and I don't recommend trying too hard to do so. It's liable to scare you when you can't. Instead just imagine your whole body jerking upwards a few times. Usually this forces my eyes open and my body awake with a sudden rush.