Thank you for your query.
The pain that you describe sounds like uterine cramps
( period like pain ).
You should definitely see a doctor to check if your uterus
is contracting prematurely, and you are at risk of preterm labour.
The mucus like discharge further could be because of preterm labour pains, or because of vaginal discharge
that is common during the third trimester.
However, it needs a clinical examination to distinguish it from various pelvic and vaginal infections that can also cause such a discharge and trigger off premature labour.
Consult your OB GYN.