Hello, this is Dr. E. Greetings from New York! I'm so glad you posted your question for me to answer, and I aim to provide you with accurate info.
It could be arterial spasm (prinzmetal's angina), or it could be electrolyte disturbance or a thyroid issue which can be checked with blood tests. Anxiety is always a diagnosis we need to keep in the back of our minds.
It can be dangerous - it predisposes to heart rhythm problems and even heart attack - you should talk to your doctor about the possibility of cardiac catheterization if they do suspect arterial spasm. There is medication you can take to reduce the spasm.