Looking at your RewriteMap it seems that you do not need to use a map. You can do it without a map:
RewriteCond %{QUERY_STRING} ^q\=([0-9]+)$
RewriteRule ^/same_url/(.*)$ http://example.com/q2=%1 [redirect=permanent,last]
Pay attention to the %1
in the RewriteRule backreferencing to the match in the RewriteCond.
If you still want to use a Rewrite map you might have to "transform" the query string into something in the path The rules could be:
RewriteCond %{QUERY_STRING} ^q\=([0-9]+)$
RewriteRule ^/(.*)$ /$1/q=%1 <-- here the GET param is transformed to something in the path
RewriteMap redirects dbm=db:/usr/local/apache/conf/redirects.db
RewriteCond ${redirects:$1} !=""
RewriteRule ^(.*)$ ${redirects:$1} [redirect=permanent,last]
You'll have to change your map to something not considering GET params:
/same_url/ http://example.com/
/same_url/q=1 http://example.com/q2=1
/same_url/q=2 http://example.com/q2=2
/same_url/q=3 http://example.com/q2=3