UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eB+LZf8Fubm5dPilFuyQ57bULFQrR1YoD565HIN6eUQ='
WHERE
key_id = 'ecc5b3ff5e0e7ba92a71f7d3f979d74ac1de8b8901da3e48b197b9e1dd42ca94'
AND (
token = 'eB+LZf8Fubm5dPilFuyQ57bULFQrR1YoD565HIN6eUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)