If Subscriber Key and EmailAddress is not same. Then you can use the below code snippet to unsubscribe.
How to unsubscribe if Subscriber Key and Email Address is Email ID using AMPScript and SSJS
Rows.Lookup in SSJS. code example to retrieve row from custom de.
How To Get Variable Value from AMPScritp to SSJS