Just a couple of hours back, the iPhone Dev Team has updated their carrier unlock tool which brings unlock for iPhone 3GS & 3G on iOS 4.1 or iOS 4.2.1 but unfortunately, you have to update your device's baseband to 06.15.00 to be able to unlock it.
Simply follow the steps below to jailbreak and unlock your iPhone 3G on iOS 4.2.1 using PwnageTool 4.1.3 for Mac OS X.
STEP 1: Download PwnageTool 4.1.3 unlock edition from here.
STEP 2: Download iOS 4.2.1 for your device and also catch iOS 3.2.2 from here before it's removed (required to update the baseband). Then copy all the files to your desktop.
STEP 3: Now launch PwnageTool and select iPhone 3GS / 3G and point it to the original iOS 4.2.1 firmware you downloaded.
STEP 4: You'll now be asked if you want to update your baseband to the 06.15 version. If you are on 05.14 or 05.15 or higher you will need to do this to unlock. You do not need to do this for jailbreak only. Click on YES and then select Browse for IPSW and point it to iOS 3.2.2 you downloaded.
STEP 9: Almost done, you can now unlock your iPhone 3GS / 3G by following my previous guide posted here.