Several ways to do this, depends on circumstances. See the comparison operators for more info.
In this particular case
SELECT Id FROM mastertable WHERE town = 'Springfield' or town = 'Lebanon' and Id<>185332;
<> means not equal. Could also use NOT IN (value list), for multiple id exclusion.