Flash it using the command: fastboot flash recovery [twrp-filename].img .

Use the command fastboot oem unlock in a terminal while the device is in bootloader mode to unlock it.