If you receive 2 codes like so:
———- Code Input Instructions ———-
1. Turn on phone with a non accepted SIM card
2. Phone will prompt you for unlock code
3. Enter unlock code
4. Your phone is unlocked!
If the phone does not accept the code, then you need to do a Factory Wipe on the phone to get it to work. It is a known bug with some versions of the MotoG software.