Try having a banana 20-30 mins before workout for the potassium (or you can supplement) and/or a half a teaspoon of normal salt (if you don't have any blood pressure issues or watching your sodium intake).
Also make sure you're well hydrated before the workout and not downing loads of water during or close to your workout, that can cause cramps also.