UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xIzW6c9neXou1JwziW+cMBjxj/KBpcVHOPK94kpP/Ms='
WHERE
key_id = '63b501216bb53d569b36aaf71027dc5c04ca1bed2bafbfd3fa8f2c565e5e7807'
AND (
token = 'xIzW6c9neXou1JwziW+cMBjxj/KBpcVHOPK94kpP/Ms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)