Set boolean field to true if query match otherwise set to false I have bunch of ids someIds (20 - 100 thousands) and table with more than 12 millions rows like that: 

spaceShips(
    id BIGINT,
    shipType TEXT,
    shipName TEXT,
    hasArtificialIntelligence boolean
)


And I need for all rows where shipType='warship' (about 2 millions) set field hasArtificialIntelligence true if spaceShips.id in someIds otherwise set false. Is there a better way than two update queries?
Yes, one update is sufficient:

UPDATE spaceShips
    SET hasArtificialIntelligence = spaceShips.id in ( ...,someIds,... )
WHERE shipType='warship'


spaceShips.id in ( ...,someIds,... ) will evaluate to either true or false (assuming someid is not null)