UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'quWc7SQdZOQplkqFp9hQWClcsNviUN6jrUhSwgTAc5E='
WHERE
key_id = '42b380b9f60afaf73066c48092ee6747d630a7a8a1e67e51cd9e79dbc6e8198b'
AND (
token = 'quWc7SQdZOQplkqFp9hQWClcsNviUN6jrUhSwgTAc5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)