If you click the Update button in iTunes to install the 3.0 firmware you will not loose your unlock. (2G iPhones ONLY).
HOWEVER, if you are using the 2G iPhone on an unofficial carrier you may loose your activation. This means that will your network will be detected but you will not be able to use your iPhone.
You will loose your activation if you used QuickPwn to jailbreak your iPhone. If you used PwnageTool you will not.
If you are super excited about iPhone 3.0 and wish to update immediately, either make sure you jailbroke with PwnageTool or rejailbreak using PwnageTool and then do the update.
Otherwise wait for a little bit and the iPhone Dev-Team will release new PwnageTool and QuickPwn utilities shortly.