[#51348451] more robust sharekey insert algorithm to prevent errors