Redshift -SCD2 snap

Has someone used Redshift SCD2 snap? I am looking for some sample pipeline to setup a SCD2 on one of my Redshift tables.
Requirement is to insert a new row and in case of an existing row ,expire the old row and insert a new row.