If you paid for the phone outright they will [should] give you the lock code. Worst case is you can go onto any number of sites and get the code for $10 or less.
The ATT version works fine on TMO as long as you aren't in one of the few remaining areas that hasn't been 're-farmed.' HSPA on AWS is in very limited use now, but markets that still depend on this protocol on this band will not play too nice with an ATT version. Most of TMO coverage though has been re-farmed so that LTE runs on AWS. These areas are fine. If I recall (don't hold me to this) all TMO markets will be re-farmed by the end of the year.