Epsom Salt will help some, but you really need a whirlpool or hottub. You need direct heat on the muscle in a massaging manner. Some tips that might prevent the cramps or leg locking is :
Warm up 5-10min on treadmill prior to lifting legs
Stretch 20-30min before workout, I mean really stretch. Focus on each muscle you will be lifting
Stay hydrated throughout your lift. Gatoraide or Poweraide Water might not cut it.
Right after you lift Stretch again for 20-30min. Really pull the muscles you just lifted.
Also you might wanna eat a Banana before you lift.
I use to get really bad calve cramps on my lifting days. They would lock up and just be painful as hell. Stretching is really all that has worked for me. I can tell now when i didnt stretch good.
Here is a link as well..Hope this helped some
GR
Muscle Spasms and Cramps - What Causes Muscle Spasms and Cramps