Is it ok to have sex?

Im almost 34 weeks. Last week I had some intense cramps in my vag, some backache and went to the hospital 3 times this week so that i could get NST readings as my doctor told me. I had some very minor contractions but nothing important.

I’m having medications, some magnesium and got a progesterone shot.

Yesterday i got a vaginal exam and everything was ok.

I’ve been feeling sooo horny and want to have sex with hubby.

I can’t take the fact that i won’t be able to do so for a long time after birth, so i was wondering if i could have it now or would it maybe worsen things? Start labor etc.?