As far as I have heard such spasm are caused due to metabolic disorders. I think you should consult a doctor to the earliest.
Have Dr. check for different Deficiency, sometimes low vitamin levels like D can cause spasms, or some of the other levels like potassium can cause spasms if low. Be sure to follow up with physician if they feel this is the cause it can easily be detected by blood test, and usually easily fixed if indeed this is what the problem is.....