Quick update.
There is NO jailbreak or unlock for phones on 3.1.3.
You have 2 options to jailbreak/unlock on 3.1.2
Pwnagetool:
http://blog.iphone-dev.org/post/376648600/pre-game-show
Which lets you make a custom firmware.
or
Blackrain:
http://blackra1n.com/
This is the
EASIEST MOST BASIC METHOD It will upload itself to the phone and then jailbreak it and then all you have to do is click the logo to install Cydia and/or unlock.
If you upgrade to 3.1.3 by accident you MAY be able to downgrade back to 3.1.2 for the purpose of jailbreaking but you will still not be able to unlock the phone as you were on 3.1.3 before.
Hope that helps!