UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gF9o9bHO8FfAOY/M0JY25cObV/SeGjIDd9PZ5dPlkOg=' 
WHERE 
  key_id = 'a28dc4ff1f62c1ba9dc315730ed7b44f3c2b23fb7a478febd228328b0529cf95' 
  AND (
    token = 'gF9o9bHO8FfAOY/M0JY25cObV/SeGjIDd9PZ5dPlkOg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025