UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TOIB4TdICwf7JEVcn3OPqFuB6oJhf3EOmjICXPFGow8=' 
WHERE 
  key_id = '343cb5340da20a9881ddc8f7265b8673849f61ff58a207c0002ca97fc81995eb' 
  AND (
    token = 'TOIB4TdICwf7JEVcn3OPqFuB6oJhf3EOmjICXPFGow8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044