UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qKyZi7LfaGAgtybSryBKtvkhoHlPq1mxstjoYafsRFY=' 
WHERE 
  key_id = '0838fbc1eaf7bb633acb1657b9a10898f62ae2717d312f8e6dabe1a20a7ab59a' 
  AND (
    token = 'qKyZi7LfaGAgtybSryBKtvkhoHlPq1mxstjoYafsRFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043