Good news from DevTeam. They just announced via twitter that unlock for firmwares 3.1.3 and 4.0 is ready:
RT @MuscleNerd: ultrasn0w tips: 1) Works for all basebands since 3.0 FW 2) Remember to disable 3G on T-Mobile USA
ultrasn0w 0.93 released! Cydia repo is repo666.ultrasn0w.com. Works with basebands 04.26.08 thru 05.13.04
This means, that all users with basebands 04.26.08, 05.11.07, 05.12.01 and 05.13.04 can use ultrasn0w 0.93.
There is no jailbreak for just released iOS4, so you need to wait a bit. Firmware 3.1.3 who need unlock can update ultrasn0w and use their iPhones with any carrier.