In men, Mitchell et al. (1998) found that positive mood induced by music affected greater sexual arousal, and that musically induced negative mood affected reduced sexual arousal. In women, Ter Kuile et al (2010) found similar results for women.
However, your question is not quite addressed by these studies. Whereas these studies address the effect of mood on arousal in the presence of erotic stimuli, it is possible that negative affect may still induce pleasure-seeking (even if it reduces the pleasurable effect of stimuli in general).
Indeed, Lykins et al. (2006) found that a subgroup of both men and women reported increased sexual interest during depressed and anxious moods. Men were more likely than women to report increases of sexual interest during negative mood states. One's inclination toward sexual excitation was the strongest predictor of this relationship between negative mood and sexual interest. To speculate a little, this may be because it moderates the effect of negative mood on arousal that is mentioned above. That is, people inclined toward sexual excitation may not show the arousal dampeningdamping effect of negative mood.
Mitchell, W. B., DiBartolo, P. M., Brown, T. A., & Barlow, D. H. (1998). Effects of positive and negative mood on sexual arousal in sexually functional males. Archives of Sexual Behavior, 27(2), 197-207.
Ter Kuile, M. M., Both, S., & Van Uden, J. (2010). The Effects of Experimentally‐Induced Sad and Happy Mood on Sexual Arousal in Sexually Healthy Women. The journal of sexual medicine, 7(3), 1177-1184.
Lykins, A. D., Janssen, E., & Graham, C. A. (2006). The relationship between negative mood and sexuality in heterosexual college women and men. Journal of Sex Research, 43(2), 136-143.