The functional equation \(\begin{aligned} \psi (x) =\prod ^{n}_{j=1} \psi \left( f_j(x)\right) ^{p_j(x)} \end{aligned}\) occurs in connection with some characterization problems in probability theory. We find the form of its solutions defined in a vicinity of zero and fulfilling a natural asymptotic condition at zero: real-valued ones for a wide class of functions \(p_1, \ldots ,p_n\) and complex-valued solutions when \(p_1= \cdots =p_n=1\) . The obtained results generalize some theorems proved by Vincze (Magyar Tud. Akad. Mat. Kutató Int., Közl 7:357–361, 1962), Laha and Lukacs (Aequationes Math. 16:259–274, 1977), Kuczma, Choczewski and Ger (Iterative Functional Equations, Encyclopedia of Mathematics and its Applications 32, Cambridge University Press, Cambridge, 1990), and Baker (Proc. Amer. Math. Soc. 121:767–773, 1994). As a consequence we obtain an extension of a result by Zdun (Aequationes Math. 8:229–232, 1972). It provides a new characterization of the complex exponential functions. We record also the form of complex-valued solutions of the equation \(\begin{aligned} \varphi (x) =\sum ^{n}_{j=1} p_j(x)\varphi \left( f_j(x)\right) \end{aligned}\) with some asymptotics at zero.