UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CIQ5CV1PFzrOoBI/4jVVOvhc/tC9QJrTc16POC1l+pQ='
WHERE
key_id = 'c502ded4b603e8e9aa9772f948ba59f62dddb1836f032b3b451ab063177f5b04'
AND (
token = 'CIQ5CV1PFzrOoBI/4jVVOvhc/tC9QJrTc16POC1l+pQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)