Your only hope is to downgrade to 3.0 following the instructions on saurik's site. This will only work if you registered your device through Cydia prior to 3.1 being released. Once downgraded, you can jailbreak using purplera1n and then upgrade to the PwnageTool-created 3.1 firmware, although since you have already installed 3.1 stock, your baseband has been upgraded and you will not be able to unlock.