On a functional equation related to the Matsumoto—Yor property