"Mitochondrial Mg2+ homeostasis decides cellular energy metabolism and vulnerability to stress"
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4960558/
Anecdotally, I've been taking Magnesium l-threonate and it's probably the least anxious I've ever been in my entire life (I'm 42).
The only thing comparable was Lexapro, but I always had a love/hate relationship because of the side effects.