Backing up and restoring the OS will not, unless I've missed something, do anything about a locked PIN on a SIM. If you've forgotten your PIN, you may need to enter a Personal Unlocking Key (PUK). If O2 can't provide one, you'll probably need to get a new SIM from O2. For more information, see:
If it's a passcode lock and you can't remember the passcode, you'll have to restore the iPhone as outlined here -> iOS: Device disabled after entering wrong passcode
If it's a SIM Lock and you can't remember the pin, you'll get three tries before you need a new SIM. You shouldn't have to restore, but if you do, you may be able to pop the SIM out and then restore the iPhone.