UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jZKEzdJHvFptVVEbGGmTxk5umQ1ydUNFT7/UAFYGBXg=' 
WHERE 
  key_id = '6588274aab5ae943c9733c4e3ee3d88e41bc2cf01195a964e4e94d946a693c5c' 
  AND (
    token = 'jZKEzdJHvFptVVEbGGmTxk5umQ1ydUNFT7/UAFYGBXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020