How can I upgrade my jailbroken and unlocked iPhone 3GS to 4.2?
There is nothing special to upgrading when jailbroken or not. You must use the official upgrade path which means losing unlock and jailbreak, and then re-jailbreak and re-unlock if you want and if it is possible with the new firmware. So...


Plug it in
Follow the prompts in iTunes