UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EHRg4PznwB7BNoHdxhC0UnCeXVsTjd9dX+OrkQn0hGs=' 
WHERE 
  key_id = 'b292fabc6da4667d2642c39b4720e89f148da92dd4d35b027fa70412b9084acf' 
  AND (
    token = 'EHRg4PznwB7BNoHdxhC0UnCeXVsTjd9dX+OrkQn0hGs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041