(a) A lessee's interest in real property may be applied to
the satisfaction of a money judgment in any of the following
circumstances:
   (1) If the lessee has the right voluntarily to sublet the property
or assign the interest in the lease.
   (2) If the lessee has the right voluntarily to sublet the property
or assign the interest in the lease subject to standards or
conditions and the purchaser at the execution sale or other assignee
agrees to comply with the standards or conditions that would have had
to be complied with had the lessee voluntarily sublet the property
or assigned the interest in the lease.
   (3) If the lessee has the right voluntarily to sublet the property
or assign the interest in the lease with the consent of the lessor,
in which case the obligation of the lessor to consent to the
assignment is subject to the same standard that would apply had the
lessee voluntarily sublet the property or assigned the interest in
the lease.
   (4) In any other case, if the lessor consents in writing.
   (b) A provision in a lease for the termination or modification of
the lease upon an involuntary transfer or assignment of the lessee's
interest is ineffective to the extent that such provision would
prevent the application of the lessee's interest to the satisfaction
of the money judgment under subdivision (a).