Here are the steps to reset the phone lock code in your Motorola. But be warned that you will LOSE ALL DATA in your mobile. So have a backup!
1. Type *#778337# and press the SEND (Green color button).
2. The phone restarts by itself.
3. Congratulations! Your phone lock has been reset to the default code and all restrictions are removed. .
I have tested the code only on Motorola W220. Try this code at your own risk. Also do let me know via comments if this code works on any other Motorola mobiles.