hello and welcome to HCM:
this could be a panic attack
, and or anxiety
or it could be A condition that is characterized by intense disagreeable feelings in the legs at rest and repose
with compulsion to move the legs to get relief from these symptoms, peak onset usually occurs during middle age, and the disorder tends to become more severe with age.