When adding a query string in the action of a rewrite rule, you've got to escape all the "?" and "&" characters in the URL.
- "?" = "?"
- "&" = "&"
The following code will work:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="^redirect$" stopProcessing="true">
<match url="^redirect$" />
<action type="Redirect" url="/long_url.aspx?key1=value1&key2=value2" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>