UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f6tx4hVYZyNP71vRjPNt/elxRUJ1HRDnnseMGFECsjM=' 
WHERE 
  key_id = '80ad02b8b48b392665072181978f27b22f9b0e1e1e4cf7064cd213351dbf8b1f' 
  AND (
    token = 'f6tx4hVYZyNP71vRjPNt/elxRUJ1HRDnnseMGFECsjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029