Few things. Yes, you should probably have eaten something. Probably could have ridden slower as well.
Anytime you're going further than you have before you need to pace yourself. Don't go as hard or as fast as you would on say a 10-20 km ride.
I can easily do a 30 mile ride (which is about 50k) without eating anything, but I've been building my endurance for a decade and 30 miles is a "short" ride for me. Even then I make sure I'm properly fueled before hand.
If you're starting your ride in the morning, make sure you had a good nutritious dinner the night prior, and eat breakfast before you head out. Doing those two things alone will make it much more doable... and then I try to have a little snack every hour, and make sure I'm taking a drink every half hour. Some bike computers will let you set up custom time/distance notifications to remind you to eat/drink if that helps.