Non-steroidal anti-inflammatory drugs (NSAIDs) are commonly used over-the-counter drugs to relieve pain or reduce fever, but new research suggests people who take them routinely could face a higher risk of a heart attack.

The study, published in The BMJ, found that all commonly used NSAIDs – ibuprofen and naproxen, which are available over the counter; and diclofenac and celecoxib, which require prescriptions in the U.S. – were associated with this increased risk.

While the absolute risk of having a heart attack after taking this medication is very small, experts say consumers should exercise caution when deciding whether or not to take NSAIDs, particularly people who are already at risk for heart trouble.

Get Breaking News Delivered to Your Inbox

"I think this study is another cautionary tale to be very careful before using these drugs and not be lulled into a place of complacency just because they're over the counter," Deepak Bhatt, M.D., executive director of interventional cardiovascular program at Brigham and Women's Hospital, told CBS News. "If someone has to use an NSAID for pain relief, the best advice is to use the lowest possible dose and for shortest amount of time possible."

Previous research has linked the use of NSAIDs to an increased risk of heart attack, but the timing of the risk, the effect of dose, treatment duration, and the comparative risks between different NSAIDs were poorly understood.

For the study, an international team of researchers led by Michèle Bally of the University of Montreal Hospital Research Center, who was then an epidemiology doctoral student at McGill University in Canada, carried out a systematic review and a meta-analysis of studies from health care databases in Canada, Finland and the United Kingdom.

Collectively, they analyzed data on 446,763 people, of whom 61,460 had a heart attack.

The results showed that heightened risk of heart attack occurred as early as in the first week of taking an NSAID, and the risk was greater with higher doses of NSAID.

The greatest risk of heart attack was seen with NSAID use at a high daily dose in the first month. High daily doses include:

Celecoxib (Celebrex) > 200 mg

Diclofenac (Voltaren, Cambia, Solaraze) > 100 mg

Ibuprofen (Advil) >1200 mg

Naproxen (Midol, Aleve, Naprelan) > 750 mg

Overall, the results showed a 20 to 50 percent increase in risk of a heart attack when using NSAIDs compared with not using these medications.

However, Bally emphasizes that the absolute risk is very small and will vary based on patient's baseline risk.

"These numbers do not mean that a person has a 20 to 50 percent risk of having a heart attack after taking those drugs," she told CBS News.

Rather, the findings mean that as a result of this increase, the risk of heart attack due to NSAIDs is on average about 1 percent annually, she said.

Bhatt, who was not involved in the study, offers some more perspective.

"Someone who is young and healthy and takes an NSAID for a sprained ankle, the risk of heart attack is already very low so it raises the risk from very low to very low," he said. "On the flip side, an 80-year-old who has high blood pressure, who's had bypass surgery, for that patient, the risk could be substantial."

The study also looked at long-term use of NSAIDs and found that the heightened risk did not seem to continue to increase even further when people took them for longer than one month. However, Bally said this should be interpreted with caution since the authors did not study repeat heart attacks; she advised it's still best to use NSAIDs for the shortest time possible.

The study was observational and cannot prove that taking NSAIDs actually causes a heart attack. The researchers note another limitation of the study is that not all the factors that could potentially influence risk could be taken into account.

The research doesn't explain underlying reasons for the link, but experts have some theories.

"Other studies show that NSAIDs can raise blood pressure and lead to fluid retention," Bhatt said. "These sorts of things can help precipitate a heart attack, particularly in people who are already vulnerable to it."

Previous research has also shown these medications may put people at risk for blood clots.

Experts say the study is not meant to scare people away from using NSAIDs, but rather to be more mindful when using them.

"If someone needs to treat occasional pain, fever, or inflammation they should consider all available treatment alternatives and get the help of the health care providers," Bally said.

She notes that people taking these drugs for chronic pain may want to consider whether the benefit of increasing the dose for better relief outweighs a possible increased risk of heart attack. They could talk to their doctors about other avenues of treatment such as physical therapy or local injections.

"The bottom line is, don't treat these drugs like candy just because they're sold over the counter," Bhatt said. "Treat them like any medications. Only use them if you really need to, lowest dose possible, for least amount of time."