you can use the second sentence, OR I'd write it like this: It was three o'clock in the morning when she suddenly realized she had locked herself out. She was baffled as to what (to do next) her next move would be. I think by phrasing it like this you create more of a sense of urgency and stress.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.