UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xnFfakcSVWbDqwTSmeU5ZEMV4fPH2+ZdUANvyBK0FVI='
WHERE
key_id = '85c12102f1cdaece29db39de48e3a29771b9a37434e243c2b7d2fe1246a12ac8'
AND (
token = 'xnFfakcSVWbDqwTSmeU5ZEMV4fPH2+ZdUANvyBK0FVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)