You can either:
1) Upgrade to 3.1.2 official, then jailbreak with blackra1n and unlock with blacksn0w, or
2) Upgrade to a pre-jailbroken custom 3.1.2 made with PwnageTool, preserving your baseband, and then unlock using ultrasn0w.
I would recommend the latter if possible. Many people (~ 10-20%) have had problems with WiFi connectivity after using blacksn0w. Since it's possible to preserve your baseband, why risk it?