UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '44y7ngjQPY+ZpoPWncqTnoLU5B9L/lvJhOJp0qSTbo4=' 
WHERE 
  key_id = '1d49dec051275ee091130eaeee12c864cd84143c2e701dd5c8af7e4aa11987cd' 
  AND (
    token = '44y7ngjQPY+ZpoPWncqTnoLU5B9L/lvJhOJp0qSTbo4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029