Here is my statement:
CASE
    WHEN
        EXISTS
        (
            SELECT
                1 
            FROM
                Transactions 
            WHERE
                Hash = 'VLEYCBLTDGGLHVQEWWIQ' 
                AND Time = 1531739096
        )
    THEN
        UPDATE
            Transactions 
        SET
            BlockID = 0, PoolHeight = NULL 
        WHERE
            Hash = 'VLEYCBLTDGGLHVQEWWIQ' 
            AND Time = 1531739096 
    ELSE
        INSERT INTO Transactions (Hash, Time, _fROM, Signature, Mode, BlockID, OutputValue, PoolHeight) 
            VALUES('VLEYCBLTDGGLHVQEWWIQ', 1531739096, 'GENESIS', 'GENESIS', - 1, 0, 0, NULL)
END;
The error:
System.Data.SQLite.SQLiteException: 'SQL logic error near "CASE": syntax error'
Basically: If Exists is true, then i want to update the record. If it doesnt exist i want to insert the record.
 
    