UPDATE multiple rows with different IDs

I am trying to figure out how to run an update to multiple rows by using their ID, for example if I have the following query I am updating based on the state and all matching rows will be affected, but what if I wanted to run that same query but based on IDs

UPDATE sometable SET state = 0 WHERE state = 1

So I want to do something like

UPDATE sometable SET state = 0 WHERE state = 1 AND id = 1

but I want to run the query in multiple items like IDs 1,2,3,4,20,45… etc

Any help is appreciated

I think I found the way, I will test it but if I am wrong please let me know, I will do

UPDATE sometable SET state = 0 WHERE state = 1 AND id = IN ($ids)

Where $ids is an array I will create based on the IDs I want to update

UPDATE: I tested that and it did work, actually instead of having a variable I did it like this just to test

UPDATE #__tlakcalendarcategories SET state = 1 WHERE state = 0 AND id IN (1,2,3,4,5,6)

That’s the way I would do it