UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rbc4OQDT7mZHMTQ7+pECbJ6ixGIA0uDqUsTiURp7WWQ='
WHERE
key_id = 'da5331b1b6b2062effb5441d432be50a2f824a3588c79f30374bcf7a489d1628'
AND (
token = 'Rbc4OQDT7mZHMTQ7+pECbJ6ixGIA0uDqUsTiURp7WWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)