UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tluhzNO+ln2vC9yPIp3yDoUJkHasSw7kRpGP31fV6s8='
WHERE
key_id = '94a1b94647f961ef5ef021489da31bb3466f6e2723efea84fa459d65411d9d2e'
AND (
token = 'tluhzNO+ln2vC9yPIp3yDoUJkHasSw7kRpGP31fV6s8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)