Happened on my 5s while standing in line at Starbucks.. Thankfully I had cash to pay of my Iced Chai...lol
Took about 30 minutes before holding the Sleep/Home button actually got the phone back on.
Happened again a few days later, at that point I tried to restore the phone, and because it was stuck in a loop, I was unable to put the phone into DFU/Restore mode, to restore it.
Went to Apple the next morning, and they didn't even try to restore it.
Issued a replacement on the spot. (under Apple Care)
One thing I did notice about a week before all this happened was my phone was Turning Off/On while I was sleeping, while the phone was on the charger.
I know this because when I got up, and tried to use Touch ID to gain access to my phone, it would prompt me to enter my password. (like you have to do when you restart your phone)