Whooping cough jab ....... should I have it done at 30weeks?

Is there any right or wrong time to have it?

I'm having it tomorrow and I'm 30+5 so wanted to make sure it's safe