UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GoDfuA3oq/hq1TPPaJeKPgMa+fZaLu3+ovumiPXgFfA=' 
WHERE 
  key_id = '67935c1c3987a9512bb6f508894b763f0ef7b803243e24a4e902008c08ba0592' 
  AND (
    token = 'GoDfuA3oq/hq1TPPaJeKPgMa+fZaLu3+ovumiPXgFfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026