Without knowing any more, IME three things can cause cramps: fit, simple overuse/muscle fatigue, and electrolytes.
If you've been riding this bike all along and haven't made any tweaks, it's not likely to be your fit.
Overuse is a possibility since you rode almost half again as long as you have in a while.
If the weather is warmer than it has been, you're probably sweating out more electrolytes than you would be if you were acclimated to it. Hammer Sustained Energy gives you a small amount of sodium and calcium, but not really as much as you may need in proportion to the calories, and no magnesium at all. How many scoops of the Sustained Energy did you have over the four hours? Were you doing anything else for electrolytes?
Speed comes from what you put behind you. - Judi Ketteler