The iPhone OS 3.1.3 update, which Apple released just under a week ago, stopped most jailbreaking tools from working. 5 days later, and it's already been hacked - with the iPhone Dev-Team releasing version 3.1.5 of its PwnageTool.
The group advises against updating to 3.1.3 at all, saying "Unless you've personally observed a problem with the reporting of your battery percentage, there's no reason to update". If you do, however, then PwnageTool 3.1.5 will allow you to preserve the jailbreak and ultrasn0w unlock. The blacksn0w unlock still doesn't work.
They also issue another warning - "iPhone 3GS users (regardless of unlock) should stay away from this and all 3.1.3 jailbreak tools unless you know you have your "SHSH hashes" backed up via Cydia. That’s because if you make a mistake you may find yourself stuck at official 3.1.3 with no way to jailbreak or come back down to 3.1.2 to jailbreak".
The hack is available on Bittorrent, and there's a bunch of mirrors and installation instructions on the hacking group's blog post about the release. Remember that jailbreaking will void your warranty, and Apple doesn't like it one bit.