If you have iPhone 3GS with New bootrom, DO NOT upgrade to iOS4. You will not be able to jailbreak and unlock it as the Jailbreak has not yet been officially released.
Well, if you accidentally did update, have patience until the dev-team or someone comes out with a Jailbreak.