diarrhea and possible mucus plug

I've had upset stomach since about 12 o clock am now and it currently 3:30 am. It is very painful and when I was pushing I couldn't tell if I was peeing also or if it was my water. But a big glob of mucus came out and I'm a little concerned