UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ynVgKINYo3AIwOJxbffwx8myp5jGoapvsLkMwglUO3Y=' 
WHERE 
  key_id = 'dd922796b2e709d46d30fbf30f552947b706ab3937e4652fe9c1bd46a5de2d7c' 
  AND (
    token = 'ynVgKINYo3AIwOJxbffwx8myp5jGoapvsLkMwglUO3Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023