Have you had any injuries to your lower back?
I have sciatica and when I exert my lower back, it compresses that nerve and causes everything from twitches in my toes to foot drop (unable to control your foot to walk) to downright charley horses.
Check next time it happens to see if you also have any sensation going down your leg or from your hip down to your feet.
Lindaru