UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nvuoEQIZ1IU2uSM5mjCPfmJYfulKlqh2l3kLKAkPFXg='
WHERE
key_id = 'fe562cfbb4254bf29e774762b802f2a8571e4e9cf80d0b72b544c6ad0c45c77c'
AND (
token = 'nvuoEQIZ1IU2uSM5mjCPfmJYfulKlqh2l3kLKAkPFXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)