def METHOD_NAME(cls, cursor: Any, query: Query, cancel_query_id: str) -> bool:
    """
    Cancel query in the underlying database.
    :param cursor: New cursor instance to the db of the query
    :param query: Query instance
    :param cancel_query_id: Redshift PID
    :return: True if query cancelled successfully, False otherwise
    """
    try:
        logger.info("Killing Redshift PID:%s", str(cancel_query_id))
        cursor.execute(
            "SELECT pg_cancel_backend(procpid) "
            "FROM pg_stat_activity "
            f"WHERE procpid='{cancel_query_id}'"
        )
        cursor.close()
    except Exception:  # pylint: disable=broad-except
        return False
    return True