2 things I thought of reading your post (before I got to the part where you mentioned it). Kidney stones & appendicitis. I have had both during pregnancy and the pain is very similar in both conditions. Keep an eye on it & if the pain becomes unbearble and you are vomiting then go to the ER as it is likely to be appendicitis. Kidney stones you can flush through by drinking lot's & lot's of water all day long.
Looking back when I was around 30 weeks I didn't feel quite right , a few niggly pains that I put down to being a 3rd pregnancy and running around after 2 other kids all day , at 34 weeks I had abdominal pain that rapidly got worse as the day went on , by the evening I was vomiting , I called my doctor and he told me to go to the hospital , 3 days I was kept on pain killers and the pain would not stop (doctor insisting it was kidney stones) , in the end they decided to do an MRI scan and my appendix had ruptured , I had to have emergency surgery where they delivered my daughter and removed the appendix , long recovery for me and felt awful , all that could have been avoided if they did an MRI at the start , an appendix can be removed if it has not ruptured and the pregnancy can continue.
So my advise if you have any doubt and you are in unbearable pain go to hospital and tell them to rule out an appendicitis first.
I hope you feel better