UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S0LoC3137zm07IQ2fHCKIsCSl+NyzRyxKbZEU51CRjY='
WHERE
key_id = '134e81b4aec70c7b7598f307c54b370d3e9276a4b7c6d62ab424eec52c3a3d8e'
AND (
token = 'S0LoC3137zm07IQ2fHCKIsCSl+NyzRyxKbZEU51CRjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)