UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HxTunfryTkGwehOt8GQSxYvJoi+ilkqtb9Hj9z5CIb8='
WHERE
key_id = 'cdaf905b6e02e5fca1965f13ed0af1774265a56808316bd65e743ed6f24b5d3f'
AND (
token = 'HxTunfryTkGwehOt8GQSxYvJoi+ilkqtb9Hj9z5CIb8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)