UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'klYoC0wCKXZViJjrXiPbNAjYsRFXIZrr6x7ayZYYWfo='
WHERE
key_id = '61c03fd8f5bab4c92802293b39fae4245221305b8ad6226d767df508bf5ccc33'
AND (
token = 'klYoC0wCKXZViJjrXiPbNAjYsRFXIZrr6x7ayZYYWfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)