Losing your mucus plug at 40w5d

I have been having contractions since yesterday evening all through the night and it's still on going now. I have been trying to time them the best I can with an app. And I also lost my mucus plug today! Trying to see if my contractions will stay 3-5 mins for at least two hours. They have been pretty strong. Anyone ever been in the same boat?