On certain functional equation related to two-sided centralizers