It’s most likely to be, as noted above, a lack of fitness. Some current thinking about cramp is that it is an expression of neuro-muscular fatigue, and is probably not really related to electrolytes.
The science is here; http://www.sportsscientists.com/2007/11/muscle-cramps-part-1-theories-and.html.
Basically, if you are low on electrolytes, how has it happened? you sweat out far more water than salts, so the concentration of salt in your body goes up, not down while exercising… Plus, if you are low on electrolytes, why do you only get cramp in the muscles you are using most, and not every muscle?
More training, not more salt.
Edit; fist bump to Emsz…