UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6uk0Ozjk2+2KS0JKsnSVl0j62LvNhdBSYS22SqmraSE='
WHERE
key_id = 'f4646fd2eee049451eff64bf0b6796a8dac08475f39d65c401d1fe3aedbb84e8'
AND (
token = '6uk0Ozjk2+2KS0JKsnSVl0j62LvNhdBSYS22SqmraSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)