Uy mama, this sounds really concerning, please go to your OB or nearest hospital right away, okay? Severe muscle pain and weakness like that need proper checking, especially when you're 5 months along.
Don't wait on this one, better safe than sorry when it comes to pregnancy!