Custom Post Types, URL rewrite on multiple CPTs

Assuming the code snippet provided works then extending the conditional statement like so will help you,

function filter_post_type_link($link, $post)
{
    if ($post->post_type="custom_post_type_1") {

        if ($cats = get_the_terms($post->ID, 'custom_cat_1'))

             $link = str_replace('%custom_cat_1%', array_pop($cats)->slug, $link);

        return $link;

    } elseif ($post->post_type="custom_post_type_2") {

        if ($cats = get_the_terms($post->ID, 'custom_cat_2'))

             $link = str_replace('%custom_cat_2%', array_pop($cats)->slug, $link);

        return $link;

    } else {

        return $link;

    }

}

add_filter('post_type_link', 'filter_post_type_link', 10, 2);