def METHOD_NAME(
    session: DbSession,
    chain: Chain,
    sync_type: ChainEventType,
    height: int,
    update_datetime: dt.datetime,
) -> None:
    upsert_stmt = (
        insert(ChainSyncStatusDb)
        .values(chain=chain, type=sync_type, height=height, last_update=update_datetime)
        .on_conflict_do_update(
            constraint="chains_sync_status_pkey",
            set_={"height": height, "last_update": update_datetime},
        )
    )
    session.execute(upsert_stmt)