UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A+JFmA0QHcZ8fRNc4j0XbZp8wqHUcecnblXl5HmXFpE=' 
WHERE 
  key_id = '7fd2be95d2ddcf0b556d2692b498b5b085a68beb1d86ca981b4e004b97e89992' 
  AND (
    token = 'A+JFmA0QHcZ8fRNc4j0XbZp8wqHUcecnblXl5HmXFpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057