The instances table is keyed on network_user_id AND network, so this function should take both parameters, for the very unlikely but possible scenario where there are two users with the same ID on two different networks.