UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LcFUBFon8HjyM7jCDrxvme5C2xGOEhmI1Lp62hf6jzc='
WHERE
key_id = '6cae12d742b7525e999274906f26c8a238dd1c66374f8b32c5a3cd6b386e3214'
AND (
token = 'LcFUBFon8HjyM7jCDrxvme5C2xGOEhmI1Lp62hf6jzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)