These kernels are called "factorizable kernels" in the book Reproducing Kernel Hilbert Spaces in Probability and Statistics.

In Chapter 7 Section 3 they derive necessary and sufficient conditions on the functions $f_1$ and $f_2$ for such a $K$ to be a kernel. Up to technical difficulties in handling zeros this boils down to $\frac {f_1} {f_2}$ being real, positive and non-decreasing.

Furthermore they give an example of a non-factorizable kernel.