If your iPhone 3G update to official apple 3.1, then it will upgrade your base band to which you can't unlock. BUT, if you search in google, there is a way to downgrade baseband (if you are qualify) back to 04.26.08.
This will work if and only if your baseband is 05.11.07 after update to 3.1. You can check by going into setting, general, about.
This is what I had done to my iPhone 3G (official apple 3.1 firmware)
- Check baseband to see if I can downgrade
- If yes, downgrade iPhone from 3.1 to 3.0.1
- jailbreak 3.0.1
- follow the steps on how to downgrade baseband
- then jailbreak with custom 3.1 firmware
- ultrasn0w to unlock
I'm with AT&T, but I tried my phone with T-Mobile sim card and it works (remember turn off 3G)
All these above is based on my experiences and all the details on how to jailbreak, downgrade baseband, and downgrade firmware can be find on the website above. Try at your own risk!!