I believe T-Mobile needs the device to be paid off & it has to be on their network for at least 40 days. I know Verizon will automatically unlock the phone after 60 days on their network w/ payments still being made.
You're probably going to just have to wait the 40 days + pay the device off before unlocking. If you have any promos, it's probably not going to be worth it, at least in my opinion.