Yes and yes. But you need sufficient calcium for the magnesium to be absorbed. The ache is acids in your muscles "breaking down" from lack of us.
get up, out, and walk as much as you can. If you have been down for a bit it will take surprisingly little walking to tire your legs out. or sit in a chair and hold one leg straight out as long as you can, then change legs. Keep it up. The best recovery for bong sore and bruised is exercise. I'm not talking about 3 hours of raquetball! LOL Sorry. Don't know how crunched you are.
"There ain't no vaccine for stupidity* Maxine