UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7BlmK0Xuj6HhXY1rh3lMz3qnMrdnYZJ/JKEHQLfDEvE=' 
WHERE 
  key_id = '035ead184b43a81321c9c1c9eae06ecbca496b3069c92d526ba0a125dba1b4ad' 
  AND (
    token = '7BlmK0Xuj6HhXY1rh3lMz3qnMrdnYZJ/JKEHQLfDEvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039