§ 130.10 Sex offenses; limitation; defenses.
  1. In any prosecution under this article in which the victim's lack of
consent is based solely upon his or her incapacity to consent because he
or she was mentally disabled,  mentally  incapacitated  or
physically helpless, it is an affirmative defense that the defendant, at
the  time he or she engaged in the conduct constituting the offense, did
not know of the facts or conditions responsible for such  incapacity  to
consent.
  2. Conduct performed for a valid medical or mental health care purpose
shall not constitute a violation of any section of this article in which
incapacity  to  consent is based on the circumstances set forth in para-
graph (h) of subdivision three of section 130.05 of this article.
  3. In any prosecution for the crime of rape in  the  third  degree  as
defined  in  section  130.25,  sodomy  in the third degree as defined in
section 130.40, aggravated sexual abuse in the fourth degree as  defined
in  section  130.65-a, or sexual abuse in the third degree as defined in
section 130.55 in which incapacity to consent is based  on  the  circum-
stances  set  forth  in  paragraph  (h)  of subdivision three of section
130.05 of this article it shall  be  an  affirmative  defense  that  the
client  or  patient  consented to such conduct charged after having been
expressly advised by the health care or mental health care provider that
such conduct was not performed for a valid medical purpose.
.