Default Root help

Hey all, I just got my moto x, it came with pre installed with 4.2.2 .. I'm on the AT&T model and was wondering do I have to unlock the phone 1st before rooting? Sorry for noob question