Experiencing chest pain is extremely common amongst patients who suffer from anxiety.
This is known in medical speak as somatisation, which is when physical symptoms are caused by mental factors. You can read more about somatisation in this great article here.
Even though your history is strongly suggestive of chest pain related to anxiety, and not of the worrying “heart attack” sort, I cannot tell for certain from the limited information that you have provided.
Suggestive risk factors for heart disease include if you are an older male with a history of smoking, diabetes, or have relatives with heart problems.
As such, if your chest pain continues to worry or bother you, I’d suggest for you to visit your GP. He will be able to readily tell the difference between anxiety-related chest pain from that caused by serious medical problems from your history.
The reason chest pain symptoms can be triggered by anxiety is because your body mounts a stress response when you are anxious, which can cause tightening of your chest muscles and an achey feeling.
If you are able to, calming yourself down with relaxation techniques will bring an end to the stress response, and will stop the chest pain. This can take up to 20 minutes.
Not to fret if you don’t know any relaxation techniques! After your doctor visit, if he determines that your chest pain is due to anxiety, he will be able to counsel you and/or refer you to a psychologist accordingly to learn and practise these techniques.